import VueRouter from 'vue-router'


import home from './components/tablebar/home.vue'
import member from './components/tablebar/member.vue'
import search from './components/tablebar/search.vue'
import shopcar from './components/tablebar/shopcar.vue'
import newslist from './components/news/newslist.vue'
import newsinfor from './components/news/newsinfor.vue'
import photolist from './components/photos/photolist.vue'
import photoinfo from './components/photos/photoinfo.vue'
import goodslist from './components/goods/goodslist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    {path: '/', redirect:'/home'},
    {path: '/home', component:home},
    {path: '/member', component:member},
    {path: '/shopcar', component:shopcar},
    {path: '/search', component:search},
    {path: '/home/newslist', component:newslist},
    {path: '/home/newsinfor/:id', component:newsinfor},
    {path: '/home/photolist',component:photolist},
    {path: '/home/photoinfo/:id',component:photoinfo},
    {path: '/home/goodslist',component:goodslist},
    {path: '/home/goodsinfo/:id',component:goodsinfo},
    {path: '/home/goodsdesc/:id',component:goodsdesc, name:'goodsdesc'},
    {path: '/home/goodscomment/:id',component:goodscomment, name:'goodscomment'},

  ],
  linkActiveClass: 'mui-active'
  //覆盖默认高亮显示的类
})

// 把路由对象暴露出去
export default router